<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>器材归还</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/jquery-1.7.2.js"></script>
<script  src="bootstrap/js/jquery-3.2.0.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript">
$(function() {
	var queryER = '${session.queryER}';
	if(queryER.length==0){
		$("#erTable").hide();
	}else{
		$("#erTable").show;
	}
});


</script>
<style type="text/css">
.navbar-expand-lg{
font-size:20px;
	font-weight:600;
	padding-left:60px;
}
.navbar-expand-lg li{
	padding-left:25px;
}
</style>
</head>
<body>
	<nav class="navbar navbar-expand-lg navbar-light bg-faded">
  <div class="container">
	  <div class="navbar-header">
	      <a class="navbar-brand" >欢迎${sessionScope.user.userName}</a>
	  </div>
    <div class="collapse navbar-collapse" id="navbarNavDropdown">
       <ul class="navbar-nav">
         <li class="nav-item "><a class="nav-link " href="${pageContext.request.contextPath }/homepage.jsp">&nbsp;首页&nbsp;</a></li>
         <s:if test="'管理用户' in #session.rolePermission_name_list">
			 <li class="nav-item dropdown">
	          <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink">用户管理</a>
	          <ul class="dropdown-menu"  aria-labelledby="navbarDropdownMenuLink">
	            <li><a class="dropdown-item" href="um-userManage">用户管理</a></li>
	            <li><a class="dropdown-item" href="rm-roleManage">角色管理</a></li>
	          </ul>
	        </li>
		</s:if>
        <li class="nav-item dropdown">
          <a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink2">器材管理</a>
          <ul class="dropdown-menu">
          	<s:if test="'管理器材' in #session.rolePermission_name_list">
				<li><a href="em-equipmentManage">器材管理</a></li>
				<li><a href="er-equipmentRent">器材租借</a></li>
				<li><a href="er-equipmentRent">器材归还</a></li>
			</s:if>
			<s:else>
				<h3>器材</h3>
				<li><a href="er-equipmentRent">器材租借</a></li>
			</s:else>
          </ul>
        </li>
        <li class="nav-item dropdown">
          <a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink3">管理场地<span class="caret"></span></a>
          <ul class="dropdown-menu">
          <s:if test="'管理场地' in #session.rolePermission_name_list">
			<li><a href="add_field.action">场地添加</a></li>
			<li><a href="field_modifyRental.action">租金修改</a></li>
			<li><a href="field_show.action">显示场地</a></li>
		</s:if>
		<s:else>
			<h3>场地</h3>
			<li><a href="fieldAll_record.action">显示场地</a></li>	
			<li><a href="fieldRent_order.action">显示租用记录</a></li>	
		</s:else>
          </ul>
        </li>
        <li class=" nav-item dropdown">
          <a href="#" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink4">赛事管理<span class="caret"></span></a>
          <s:if test="'管理赛事' in #session.rolePermission_name_list">
			<ul class="dropdown-menu">
				<li><a href="matchApply_findAll.action?currPage=1" >查看赛事申请表</a></li>
				<li><a href="matchApply_apply.action">新建赛事申请表</a></li>
				<li><a href="matchApply_examine.action?currPage=1">审核赛事申请表</a></li>
				<li><a href="matchApply_delete.action?currPage=1" >删除赛事申请表</a></li>
				<li><a href="matchInfo_findAll.action?currPage=1" >查看赛事信息表</a></li>
				<li><a href="matchInfo_listUpdate.action?currPage=1" >更新赛事信息表</a></li>
				<li><a href="matchInfo_delete.action?currPage=1">删除赛事信息表</a></li>
			</ul>
		</s:if>
		<s:else>
			<li><a href="matchApply_findAll.action?currPage=1" >查看赛事申请表</a></li>
			<li><a href="matchInfo_findAll.action?currPage=1">查看赛事信息表</a>	</li>
		</s:else>
        </li>
       </ul>
      </div>
            <%-- <div class="navbar-header">
	      <a class="navbar-brand pull-right" >${sessionScope.user.userName}</a>
	  </div> --%>
  </div>
</nav>
	<form action="er-queryER" method="post">	
	
		用户编号<input name="returnUserId" type="text" value="${returnUserId}"/>
		<br/>
		器材编号<input name="epId" type="text"  onkeyup="value=this.value.replace(/\D+/g,'')"
									value="${epId}" />
		
		<input  type="submit" value="查询"/>
		
	</form>
	
	<hr/>
	
	<div id = "erTable">
		<table>
			<tr>
				<th>用户编号</th>
				<th>器材编号</th>					
				<th>租借时间</th>					
				<th>租借时长(天)</th>					
				<th>租借总花费(元)</th>					
				<th>操作</th>					
				
			</tr>
			<s:iterator value="#session.queryER" var="r">
				<tr>
					<td><s:property value="#r.renterId"/></td>									
					<td><s:property value="#r.equipmentId"/></td>									
					<td><s:date name="#r.rentTime" format="yyyy/MM/dd"/></td>									
					<td><s:property value="#r.rentDuration"/></td>									
					<td><s:property value="#r.rentCost"/></td>									
					<td>
						<a href="er-executeReturn?r_id=<s:property value="#r.rentId"/>&e_id=<s:property value="#r.equipmentId"/>">
					归还</a>
					</td>									
					
				</tr>				
			</s:iterator>
		</table>
	</div>
	
</body>
</html>